package com.example.day07.mapper;

import com.example.day07.pojos.Emp;
import com.example.day07.vo.EmpVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmpMapper {
    List<Emp> list();

    void update(Emp emp);

    Emp getById(long id);

//    @Select("select * from tb_emp where name like '%${name}%'")
//    List<Emp> getByName(String name);

    @Select("select * from tb_emp where name like #{name}")
    List<Emp> getByName(@Param("name") String name);

    @Select("select * from tb_emp limit #{p},#{size}")
    List<EmpVO> getPage(@Param("p") int p, @Param("size") int size);

}
